const request = require('../../utils/kzj.request.js');
/**
 * 每一个页面对应一个contoller
 */
class controllerM {

  /**
   * 登录
   * @return {Promise}
   */
  //获取销售人员
  getSales(params){
    return request.post(`/api/shop/shopStaff`,params,false).then(res =>res.data)
  }
  //店铺订单统计
  orderCount(params) {
    return request.post(`/api/order/statistics`,params).then(res => res.data)
  }

  //店铺首页信息
  shopInfo(params){
    return request.post(`/api/shop/shopIndex`,params).then(res => res.data)
  }

  //店铺订单列表
  orderList(params){
    return request.post(`/api/order/shopPage`,params).then(res => res.data)
  }

  //店铺用户订单列表
  userOrderList(params){
    return request.post(`/api/order/lookAccountPage`,params).then(res => res.data)
  }

  //订单完成服务
  serviceComplete(params){
    return request.post(`/api/order/orderSuccess`,params).then(res => res.data)
  }

  //订单详情
  serviceorderDetail(params){
    return request.post(`/api/order/orderDetails`,params).then(res => res.data)
  }

  //云商品通知取货
  noticeGet(params){
    return request.post(`/api/order/noticeOrder`,params).then(res => res.data)
  }

  //获取代客预约服务商品列表
  daiServiceList(params){
    return request.post(`/api/goods/labelGoodsPage`,params).then(res => res.data)
  }
  
  //获取代客预约一级分类列表
  daiServiceLabels(params){
    return request.post(`/api/label/selectLabel`,params).then(res => res.data)
  }

  //确认待客预约订单
  comfirmDai(params){
    return request.post(`/api/order/replaceCustomer`,params).then(res =>res.data)
  }

  //获取用户列表
  getUser(params){
    return request.post(`/api/shop/accountList`,params).then(res => res.data)
  }

  //获取技师列表
  getMaster(params){
    return request.post(`/api/shop/staffList`,params).then(res => res.data)
  }

  //获取预约记录列表
  getAppointRecord(params){
    return request.post(`/api/goods/agree/shopPage`,params).then(res => res.data)
  }

  //获取预约记录详情
  getAppointeRecordDetail(params){
    return request.post(`/api/goods/agree/agreeDetail`,params).then(res => res.data)
  }

  //拒绝预约
  rejectAppointment(params){
    return request.post(`/api/goods/agree/cancelOrder`,params).then(res =>res.data)
  }

  //同意预约
  agreeAppointment(params){
    return request.post(`/api/goods/agree/agreeOrder`,params).then(res =>res.data)
  }

  //确认签到
  comfirmOk(params){
    return request.post(`/api/goods/agree/ok`,params).then(res => res.data)
  }
  //获取员工简洁详情
  staffIndex(params){
    return request.post(`/api/shop/staffIndex`,params).then(res => res.data)
  }
  //店铺员工提成统计
  shopStaffTotal(params){
    return request.post(`/api/transaction/shopStaffTotal`,params).then(res =>res.data)
  }
  //店铺员工提成统计记录
  shopStaffList(params){
    return request.post(`/api/transaction/shopStaffList`,params).then(res => res.data)
  }
  //店铺员工订单列表
  staffPage(params){
    return request.post(`/api/order/staffOrderPage`,params).then(res => res.data)
  }
  //同意线上支付订单的预约
  successPayOrder(params){
    return request.post(`/api/goods/agree/successPayOrder`,params).then(res => res.data)
  }
  //拒绝线上支付订单的预约
  failPayOrder(params){
    return request.post(`/api/goods/agree/failPayOrder`,params).then(res => res.data)
  }
   //获取员工列表
   getStaffList(params){
    return request.post(`/api/shop/shopStaff`,params).then(res =>res.data)
  }

  //获取订单统计
  getOrderStatistics(params){
    return request.post(`/api/shop/orderStatistics`,params).then(res =>res.data)
  }

  //获取用户统计
  getUserStatistics(params){
    return request.post(`/api/shop/accountStatistics`,params).then(res =>res.data)
  }

  // 取消订单
  cancelOrder(params){
    return request.post(`/api/order/cancelOrder`,params).then(res =>res.data)
  }
//申请提现
shopStaffWithdraw(params) {
  return request.post(`/api/withdraw/shopStaffWithdraw`, params).then(res => res.data)
}



}
/**
 * 实例化对象
 */
let Controller = new controllerM();
/**
 * 暴露对象，无需每次都加函数名
 */
module.exports = {
  controller: Controller
}